﻿using System.Collections.Generic;

using SWE4.Data.EmbeddedSensorCloud.DTO.Request;
using SWE4.Data.EmbeddedSensorCloud.DTO.Response;

namespace EmbeddedSensorCloud.Plugin.MicroERP
{
    public interface ICustomerDAO
    {
        uint Create(CustomerRequestModel customer);

        /// <summary>
        /// Retrieves a collection of customer models from the database. If choosen so only companies will be retrieved.
        /// </summary>
        /// <exception cref="BadRequestException" />
        IEnumerable<CustomerResponseModel> Read(string searchQuery, bool onlyCompanies);

        /// <summary>
        /// Retrieves a single customer model from the database.
        /// </summary>
        /// <exception cref="MySqlException" />
        /// <exception cref="CompanyNotFoundException" />
        CustomerResponseModel Read(uint customerId);

        void Update(CustomerRequestModel customer, uint customerId);

        void Delete(uint customerId);
    }
}
